<#include "/common/_layout.html"/> <@layout>
<script type="text/javascript">
	function addItem() {
		alert("ok");
	}
	//下面用于多图片上传预览功能
	function setImagePreviews(avalue) {
		var docObj = document.getElementById("doc");
		var dd = document.getElementById("dd");
		dd.innerHTML = "";
		var fileList = docObj.files;
		for (var i = 0; i < fileList.length; i++) {
			dd.innerHTML += " <img id='img" + i + "'  />";
			var imgObjPreview = document.getElementById("img" + i);
			if (docObj.files && docObj.files[i]) {
				//火狐下，直接设img属性
				imgObjPreview.style.display = 'block';
				imgObjPreview.style.width = '120px';
				imgObjPreview.style.height = '120px';
				//imgObjPreview.src = docObj.files[0].getAsDataURL();
				//火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
				imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
			} else {
				//IE下，使用滤镜
				docObj.select();
				var imgSrc = document.selection.createRange().text;
				alert(imgSrc)
				var localImagId = document.getElementById("img" + i);
				//必须设置初始大小
				localImagId.style.width = "120px";
				localImagId.style.height = "120px";
				//图片异常的捕捉，防止用户修改后缀来伪造图片
				try {
					localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
					localImagId.filters
							.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
				} catch (e) {
					alert("您上传的图片格式不正确，请重新选择!");
					return false;
				}
				imgObjPreview.style.display = 'none';
				document.selection.empty();
			}
		}
		$("#imgup").submit();
		return true;
	}
</script>
<div>
<form action="Zbsz-add.html" method="post">
	<div class="form-group">
		<h4>标题${id}</h4>
		<input type="text" class="form-control" name="title"
			placeholder="请输入标题">
	</div>
	<div class="form-group">
		<h4>分类</h4>
		<label> <input name="Fruit" type="radio" value="0"
			checked="checked" /> 轮胎/轮毂
		</label> <label><input name="Fruit" type="radio" value="1" /> 车体外观 </label> <label><input
			name="Fruit" type="radio" value="2" /> 内饰 </label> <label><input
			name="Fruit" type="radio" value="3" /> 润滑油/添加剂 </label> <label><input
			name="Fruit" type="radio" value="4" /> 制动系统 </label> <label><input
			name="Fruit" type="radio" value="5" /> 进气/排气系统 </label> <label><input
			name="Fruit" type="radio" value="6" /> 车体加固 </label> <label><input
			name="Fruit" type="radio" value="7" /> 悬挂系统 </label> <br /> <label><input
			name="Fruit" type="radio" value="8" /> 动力系统 </label> <label><input
			name="Fruit" type="radio" value="9" /> 车灯照明 </label> <label><input
			name="Fruit" type="radio" value="10" /> 车载仪表 </label> <label><input
			name="Fruit" type="radio" value="11" /> 汽车美容 </label> <label><input
			name="Fruit" type="radio" value="12" /> 安全/防盗 </label> <label><input
			name="Fruit" type="radio" value="13" /> 配饰/小物件 </label> <label><input
			name="Fruit" type="radio" value="14" /> 自驾纪录 </label>
	</div>
	<div id="zs1">
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
		<div class="form-group parts">

			<div style="float: left; width: 120px; height: 168px;">

				<input type="file" name="file" id="doc" multiple="multiple"
					style="width: 120px;" onchange="javascript:setImagePreviews();"
					accept="image/*" />
				<div id="dd" style="width: 120px; height: 120px;"></div>
			</div>
			<div style="float: left; width: 790px; height: 168px; margin: 0 5px;">
				<textarea style="width: 100%; height: 100%"></textarea>
			</div>

			<!-- <div style="clear: both"></div> -->
		</div>
	</div>
	<div class="form-group">
		<div
			style="width: 945px; height: 60px; overflow: hidden; background-image: url('/attached/siteimg/banner.jpg')">
		</div>
		<button type="submit" class="btn btn-primary">提交</button>
	</div>
</form>
</div>
</@layout>
